package com.gjxx.common.mp.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.gjxx.common.mp.mapper.MpBaseMapper;
import com.gjxx.common.mp.service.MpService;
import org.springframework.util.CollectionUtils;

import java.util.List;

/**
 * @author zhaxc
 */
public class MpServiceImpl<M extends MpBaseMapper<T>, T> extends ServiceImpl<M, T> implements MpService<T> {

    @Override
    public Boolean insertBatchSomeColumn(List<T> batchList) {
        if (CollectionUtils.isEmpty(batchList)) {
            return false;
        }
        return baseMapper.insertBatchSomeColumn(batchList) == batchList.size();
    }

    @Override
    public Boolean insertBatchSomeColumn(List<T> batchList, Integer size) {
        if (CollectionUtils.isEmpty(batchList)) {
            return false;
        }
        return baseMapper.insertBatchSomeColumn(batchList, size) == batchList.size();
    }
}
